package org.htmlparser.tags;

import java.util.Vector;
import org.htmlparser.Attribute;
import org.htmlparser.lexer.Page;
import org.htmlparser.nodes.TagNode;
import org.htmlparser.util.ParserException;

public class MetaTag extends TagNode
{
  private static final String[] mIds;

  static
  {
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "META";
    mIds = arrayOfString;
  }

  public void doSemanticAction()
    throws ParserException
  {
    if ("Content-Type".equalsIgnoreCase(getHttpEquiv()))
    {
      String str = getPage().getCharset(getAttribute("CONTENT"));
      getPage().setEncoding(str);
    }
  }

  public String getHttpEquiv()
  {
    return getAttribute("HTTP-EQUIV");
  }

  public String[] getIds()
  {
    return mIds;
  }

  public String getMetaContent()
  {
    return getAttribute("CONTENT");
  }

  public String getMetaTagName()
  {
    return getAttribute("NAME");
  }

  public void setHttpEquiv(String paramString)
  {
    Attribute localAttribute = getAttributeEx("HTTP-EQUIV");
    if (localAttribute != null)
      localAttribute.setValue(paramString);
    while (true)
    {
      return;
      getAttributesEx().add(new Attribute("HTTP-EQUIV", paramString));
    }
  }

  public void setMetaTagContents(String paramString)
  {
    Attribute localAttribute = getAttributeEx("CONTENT");
    if (localAttribute != null)
      localAttribute.setValue(paramString);
    while (true)
    {
      return;
      getAttributesEx().add(new Attribute("CONTENT", paramString));
    }
  }

  public void setMetaTagName(String paramString)
  {
    Attribute localAttribute = getAttributeEx("NAME");
    if (localAttribute != null)
      localAttribute.setValue(paramString);
    while (true)
    {
      return;
      getAttributesEx().add(new Attribute("NAME", paramString));
    }
  }
}